import Mock from 'mockjs'

//使用mockjs模拟数据
Mock.mock('/blogs/getUserOfBlogsOfTags', {
  "ret": 0,
  "data|6": [ //生成6条数据 数组
    {
      "tagsId|+1": 1,//生成商品id，自增1
      "tagsName": "@cname(10)", //生成标签名，长度为10个汉字
      "tagsLink": "@tagsLink",//生成商品名 ， 都是中国人的名字
      "tagsIcon": "el-icon-s-home",//生成随机电话号
      "tagsArticleNum|30-1000": 30, //随机生成地址
      // "shopStar|1-5": "★", //随机生成1-5个星星
      // "salesVolume|30-1000": 30, //随机生成商品价格 在30-1000之间
    }
  ]
//data里的属性看不懂，需要详细看语法规范,博客链接:https://www.jianshu.com/p/4579f40e6108
});

//按照标签获取文章
Mock.mock('/blogs/getUserOfBlogsOfTags', {
  "ret": 0,
  "data|6": [ //生成6条数据 数组
    {
      "articleId|+1": 1,
      "articleTitle": '@ctitle',
      "articleContent": '',
      "articleClassify": '@cname(10)',
      "articleTags": [],
      "articleUnlike": '',
      "articleUsername": "@cname(5)",
      "articleRanking": 1,
      "articleCover": 'https://pic2.zhimg.com/v2-39942da94a5c498df5e833db1b97df79_r.jpg',
      "articleCollect": '',
      "articleLike": '',
      "articleTime": '',
      "articleUpdateTime": "@datetime",
      "articleStatus": 3
    }
  ]
//data里的属性看不懂，需要详细看语法规范,博客链接:https://www.jianshu.com/p/4579f40e6108
});



//按照标签获取文章

Mock.mock('/blogsManage/articleList', {
  "ret": 0,
  "data|10": [ //生成6条数据 数组
    {
      "articleId|+1": 1,
      "articleTitle": '@ctitle',
      "articleContent": '',
      "articleClassify": '@cname(10)',
      "articleTags": [],
      "articleUnlike": '',
      "articleUsername": "@cname(5)",
      "articleRanking": 1,
      "articleCover": 'https://pic2.zhimg.com/v2-39942da94a5c498df5e833db1b97df79_r.jpg',
      "articleCollect": '',
      "articleLike": '',
      "createTime": '@datetime',
      "articleUpdateTime": "@datetime",
      "articleStatus": 3
    }
  ]
//data里的属性看不懂，需要详细看语法规范,博客链接:https://www.jianshu.com/p/4579f40e6108
});



Mock.mock(/blogs\/getBlogsTags/, 'post', () => { //三个参数。第一个：路径，第二个：请求方式post/get，第三个：回调，返回值
  console.log('执行了mock js ....')
  return {data}
})
